Activity Diagram for Stack Overflow

Create some activity diagrams for the Stack Overflow problem.

Activities diagrams are a great way to visualize the flow of messages from one activity to the other in the system. There can be different activity diagrams that we can create for our Stack Overflow system. In this lesson, we will create activity diagrams for the following two activities:

  • A member posting a question

  • Activity challenge: A member closes a question.

A member posting a question#

The following are the states and actions that will be involved in this activity diagram.

States#

Initial state: The member clicks on the “Ask Question” button.

Final state: There are two final states present in this activity diagram, shown below:

  • The question was successfully posted.

  • The question is not posted.

Actions#

The member clicks on the “Ask Question” button and fills in the required fields. The member is then asked if they want to add a tag. After the post is composed, the system checks if the terms of service are followed. The question is posted only if the terms of service are followed.

The activity diagram for a member posting a question
The activity diagram for a member posting a question

Activity challenge: A member closes a question#

You’ll help us create an activity diagram of a member closing a question.

A skeleton of the activity diagram is provided below:

The activity diagram for a member closing a question
The activity diagram for a member closing a question

Notice that the actions in the diagram above are numbered from 1 to 10. The slots below represent the activities, and the arrows represent the flow from one activity to the other.

Can you rearrange the slots below in the correct order they should appear in the activity diagram given above?

Note: If you get stuck, just click the “Show Solution” button to check out the correct answer.

Fill the missing slots with the correct actions for a member closing a question.

Press the “Close Question” button

Account status?

User

Moderator

Sufficient reputation?

Vote for close question

Close vote not casted

Three or more close votes?

The question closes

Close vote casted


Alternatively, you can click the "Show complete diagram" button below to see the complete activity diagram.

We've looked at some of the activity diagrams of our Stack Overflow system. In the next lesson, we will present the code for our designed classes in some of the most popular languages.

Sequence Diagram for Stack Overflow

Code for Stack Overflow